Repository navigation
fix: close public share connections when the owner is deactivated or deleted - #417
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e97a65abb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Closed when the share's password is set or changed, the share is deleted or its owner deactivated. Left unvalidated so the | ||
| // first call checks the share again, covering a change made since it was read above. | ||
| _connectionTracker.TrackPublicShare(Context, id, share.PasswordStamp); | ||
| _connectionTracker.TrackPublicShare(Context, id, share.OwnerId, share.PasswordStamp); |
There was a problem hiding this comment.
Close connections that race with owner revocation
If the owner is deactivated after the share query at line 70 but before this connection is tracked, the UserAuthRevoked handler can run before PublicShareOwnerId is attached and miss the connection. The reset validation only checks the share on a later hub invocation, so an idle connection can remain open indefinitely despite the owner deactivation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
By design. The same window exists for password changes and share deletion (#416) and for session revocation (#407): a connection tracked after the revocation was published is not closed, but it is left unvalidated, so its first hub call checks the share against the database before anything runs. An idle connection that slipped through can't control any shocker.
When a public share's owner is deactivated or deleted, guests and logged-in visitors connected to that share stayed connected.
AbortUser(driven byUserAuthRevoked, published only on account deactivation) also closes connections to that user's public shares.Hub_DeactivatingTheOwner_ClosesGuestsAndLoggedInVisitors.redisPubServiceparam onDeletePublicShare.Summary by CodeRabbit